package ru.jetsoft.reg112.desktop.control;

import javafx.geometry.Insets;
import javafx.scene.Node;
import javafx.scene.control.ScrollPane;
import ru.jetsoft.reg112.desktop.data.Param;

public class TabControl extends BaseGroupControl {

    private final ScrollPane scrollPane;

    public TabControl(Param param) {
        super(param);
        scrollPane = new ScrollPane();
        scrollPane.setContent(getVBox());
        getVBox().setPadding(new Insets(10, 10, 10, 10));
    }

    @Override
    protected void refresh() {
        getVBox().getChildren().clear();
        for(ControlContainer child: getChilds()) {
            getVBox().getChildren().add(child.getNode());
        }
    }

    @Override
    public Node getNode() {
        return scrollPane;
    }
}
